#ifndef LIBGUA_BIND_H
#define LIBGUA_BIND_H

#include "ELuna54.h"
#include <windows.h>
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif

extern lua_State* L;
#define ccc_register_state state
#define ccc_register_func(_func_) ELuna::registerFunction(ccc_register_state, #_func_, _func_)

// extern CRITICAL_SECTION s_criticalSection;
#define ccc_en_lock // EnterCriticalSection(&s_criticalSection)
#define ccc_un_lock // LeaveCriticalSection(&s_criticalSection)

using sPointer = unsigned long long;
#define ccc_bind_declspec static inline

// #define ccc_use_traceback
#if defined(ccc_use_traceback)
extern int traceback_index;
extern int traceback(lua_State *ccc_register_state);
#endif

void registerGGE(lua_State* ccc_register_state);
void registerScheduler(lua_State* ccc_register_state);

#endif